<template>
  <div class="app-container">
    <el-container>
      <el-aside width="200px">
        <el-card class="box-card">
          <div slot="header" class="clearfix">
            <span>文章类型</span>
          </div>
          <el-tree :data="data" :props="defaultProps" default-expand-all @node-click="handleNodeClick"/>
        </el-card>
      </el-aside>
      <el-main style="padding: 0 0 0 10px">
        <el-card class="box-card">
          <div slot="header" class="clearfix">
            <span>文章列表</span>
            <el-button style="float: right; padding: 3px 0" type="text">新增</el-button>
          </div>
          <div>
            <el-table
              :data="tableData"
              style="width: 100%">
              <el-table-column
                prop="date"
                label="日期"
                width="180"/>
              <el-table-column
                prop="name"
                label="姓名"
                width="180"/>
              <el-table-column
                prop="address"
                label="地址"/>
              <el-table-column
                fixed="right"
                label="操作"
                width="100">
                <template slot-scope="scope">
                  <el-button type="text" size="small" @click="handleClick(scope.row)">查看</el-button>
                  <el-button type="text" size="small">编辑</el-button>
                </template>
              </el-table-column>
            </el-table>
          </div>
          <div style="margin-top: 10px;float: right;padding-right:10px;margin-bottom: 10px ">
            <el-pagination
              :page-size="20"
              :pager-count="11"
              :total="1000"
              layout="prev, pager, next"/>
          </div>
        </el-card>
      </el-main>
    </el-container>
    <div/>
  </div>
</template>

<script>

export default {
  name: 'JstudyDetailsList',
  data() {
    return {
      tableData: [{
        date: '2016-05-02',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1518 弄'
      }, {
        date: '2016-05-04',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1517 弄'
      }, {
        date: '2016-05-01',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1519 弄'
      }, {
        date: '2016-05-03',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1516 弄'
      }],
      data: [{
        label: '一级 1',
        children: [{
          label: '二级 1-1',
          children: [{
            label: '三级 1-1-1'
          }]
        }]
      }, {
        label: '一级 2',
        children: [{
          label: '二级 2-1',
          children: [{
            label: '三级 2-1-1'
          }]
        }, {
          label: '二级 2-2',
          children: [{
            label: '三级 2-2-1'
          }]
        }]
      }, {
        label: '一级 3',
        children: [{
          label: '二级 3-1',
          children: [{
            label: '三级 3-1-1'
          }]
        }, {
          label: '二级 3-2',
          children: [{
            label: '三级 3-2-1'
          }]
        }]
      }],
      defaultProps: {
        children: 'children',
        label: 'label'
      }
    }
  },
  mounted() {
  },
  methods: {
    handleClick(row) {
      console.log(row)
    }
  }
}
</script>

<style scoped>
.editor-content{
  margin-top: 20px;
}
.el-tag + .el-tag {
  margin-left: 10px;
}
.button-new-tag {
  margin-left: 10px;
  height: 32px;
  line-height: 30px;
  padding-top: 0;
  padding-bottom: 0;
}
.input-new-tag {
  width: 90px;
  margin-left: 10px;
  vertical-align: bottom;
}
</style>

